home *** CD-ROM | disk | FTP | other *** search
- {$S40,D-,P-,R-,T-}
- PROGRAM gem4arc1 ;
- { GEM menu to run the ARC.TTP program. Written in OSS Personal Pascal }
- { All functions are supported except for redirection }
- { Works in med and high rez. ARC.TTP must be in current directory }
- { Portions of this product are Copyright (c) 1986 OSS and CCD }
- { Used by Permission of OSS }
- { Written by William R. Good OCT 1986. Released to public domain }
-
- CONST
- {$I GEMCONST.PAS}
-
- TYPE
- {$I gemtype.pas}
-
- PREC = PACKED RECORD
- curpath : PACKED ARRAY [ 1..64 ] of Char ;
- END ;
-
-
- VAR
- temp1, temp2, temp3,
- main_selection, sec_selection,
- arc_name, path, tempname : string ;
- search_mask : string[255] ;
- test, selection, flag : boolean ;
-
- {$I gemsubs}
-
- { Start GEMDOS calls }
-
- FUNCTION cur_drive : integer ; { 0 = A 1 = B }
- GEMDOS ( $19 ) ;
-
- PROCEDURE get_dir( VAR buffer : PREC ; drive : integer ) ;
- GEMDOS ( $47 ) ;
-
- { End GEMDOS calls }
-
- { Start XBIOS calls }
-
- FUNCTION getrez : integer ; { 0 = low 1 = med 2 = high }
- XBIOS ( $4 ) ;
-
- { End XBIOS calls }
-
- PROCEDURE find_rez ;
- { check current rez }
-
- VAR
- button : integer ;
- alerttext : string[255] ;
- part1, part2 : string ;
- BEGIN
- if getrez < 1 then
- Begin
- part1 := '[3][GEM4ARC1 runs in med or high |' ;
- part2 := 'rez. Please change rez][ SORRY ]' ;
- alerttext := Concat ( part1, part2 ) ;
- button := Do_Alert(alerttext,1) ;
- halt ;
- END ;
- END ; {find_rez}
-
- PROCEDURE get_pathname ( VAR fullpath : string ) ;
-
- VAR
-
- temp_num, drive_num : integer ;
- place : integer ;
- drive_ltr : char ;
- testpath : string ;
- temppath : PREC ;
-
- BEGIN
- drive_num := cur_drive ;
- temp_num := drive_num + 65 ;
- drive_ltr := chr( temp_num ) ;
- drive_num := drive_num + 1 ;
- get_dir( temppath, drive_num ) ;
- with temppath DO
- BEGIN
- place := 1 ;
- testpath := '' ;
-
- WHILE ( place <=64 ) AND ( curpath[place] <> chr(0)) DO
- BEGIN
- testpath := concat(testpath, curpath[place]) ;
- place := place + 1 ;
- END ;
- fullpath := concat( drive_ltr, ':', testpath, '\' ) ;
- END ;
- END ; {get_pathname}
-
- PROCEDURE make_main( mdialog : dialog_ptr ; VAR madd : integer ;
- VAR mmove : integer ; VAR mupdate : integer ;
- VAR mfreshen : integer ; VAR mextract : integer ;
- VAR mdelete : integer ; VAR mrun : integer ;
- VAR mcopy : integer ; VAR mlist : integer ;
- VAR mverbose : integer ; VAR mtest : integer ;
- VAR mconvert : integer ) ;
-
- BEGIN
- { main file options }
-
- madd := Add_DItem( mdialog, G_Button,selectable|Radio_btn,
- 1, 9, 10, 1, 1, $1180 ) ;
- Set_DText( mdialog, madd, 'ADD', System_Font, TE_Center ) ;
-
- mmove := Add_DItem( mdialog, G_Button,selectable|Radio_btn,
- 12, 9, 10, 1, 1, $1180 ) ;
- Set_DText( mdialog, mmove, 'MOVE', System_Font, TE_Center ) ;
-
- mupdate := Add_DItem( mdialog, G_Button,selectable|Radio_btn,
- 23, 9, 10, 1, 1, $1180 ) ;
- Set_DText( mdialog, mupdate, 'UPDATE', System_Font, TE_Center ) ;
-
- mfreshen := Add_DItem( mdialog, G_Button,selectable|Radio_btn,
- 1, 11, 10, 1, 1, $1180 ) ;
- Set_DText( mdialog, mfreshen, 'FRESHEN', System_Font, TE_Center ) ;
-
- mextract := Add_DItem( mdialog, G_Button,selectable|Radio_btn,
- 12, 11, 10, 1, 1, $1180 ) ;
- Set_DText( mdialog, mextract, 'EXTRACT', System_Font, TE_Center ) ;
-
- mdelete := Add_DItem( mdialog, G_Button,selectable|Radio_btn,
- 23, 11, 10, 1, 1, $1180 ) ;
- Set_DText( mdialog, mdelete, 'DELETE', System_Font, TE_Center ) ;
-
- mrun := Add_DItem( mdialog, G_Button,selectable|Radio_btn,
- 1, 13, 10, 1, 1, $1180 ) ;
- Set_DText( mdialog, mrun, 'RUN', System_Font, TE_Center ) ;
-
- mcopy := Add_DItem( mdialog, G_Button,selectable|Radio_btn,
- 12, 13, 10, 1, 1, $1180 ) ;
- Set_DText( mdialog, mcopy, 'COPY', System_Font, TE_Center ) ;
-
- mlist := Add_DItem( mdialog, G_Button,selectable|Radio_btn,
- 23, 13, 10, 1, 1, $1180 ) ;
- Set_DText( mdialog, mlist, 'LIST', System_Font, TE_Center ) ;
-
- mverbose := Add_DItem( mdialog, G_Button,selectable|Radio_btn,
- 1, 15, 10, 1, 1, $1180 ) ;
- Set_DText( mdialog, mverbose, 'VERBOSE', System_Font, TE_Center ) ;
- Obj_SetState( mdialog, mverbose, selected, False ) ;
-
- mtest := Add_DItem( mdialog, G_Button,selectable|Radio_btn,
- 12, 15, 10, 1, 1, $1180 ) ;
- Set_DText( mdialog, mtest, 'TEST', System_Font, TE_Center ) ;
-
- mconvert := Add_DItem( mdialog, G_Button,selectable|Radio_btn,
- 23, 15, 10, 1, 1, $1180 ) ;
- Set_DText( mdialog, mconvert, 'CONVERT', System_Font, TE_Center ) ;
- END ; { make_main }
-
- PROCEDURE make_second( VAR sdialog : dialog_ptr ; VAR shold : integer ;
- VAR sretain : integer ; VAR ssuppr_comp : integer ;
- VAR ssuppr_warn : integer ; VAR ssuppr_not : integer ;
- VAR sencript : integer ) ;
-
- BEGIN
- { secondary options }
-
- shold := Add_DItem( sdialog, G_Button,selectable,
- 38, 9, 15, 1, 2, $1180 ) ;
- Set_DText( sdialog, shold, 'HOLD SCREEN', System_Font, TE_Center ) ;
- Obj_SetState( sdialog, shold, selected, False ) ;
-
- sretain := Add_DItem( sdialog, G_Button,selectable,
- 54, 9, 15, 1, 2, $1180 ) ;
- Set_DText(sdialog, sretain, 'RETAIN BACKUP', System_Font, TE_Center ) ;
-
- ssuppr_comp := Add_DItem( sdialog, G_Button,selectable,
- 38, 11, 31, 1, 2, $1180 ) ;
- Set_DText( sdialog, ssuppr_comp,
- 'SUPPRESS COMPRESSION', System_Font, TE_Center ) ;
-
- ssuppr_warn := Add_DItem( sdialog, G_Button,selectable,
- 38, 13, 31, 1, 2, $1180 ) ;
- Set_DText( sdialog, ssuppr_warn,
- 'SUPPRESS WARNING MESSAGES', System_Font, TE_Center ) ;
-
- ssuppr_not := Add_DItem( sdialog, G_Button,selectable,
- 38, 15, 31, 1, 2, $1180 ) ;
- Set_DText( sdialog, ssuppr_not,
- 'SUPPRESS NOTES', System_Font, TE_Center ) ;
-
- sencript := Add_DItem( sdialog, G_Button,selectable,
- 38, 17, 31, 1, 2, $1180 ) ;
- Set_DText( sdialog, sencript,
- 'ENCRIPT / DECRIPT', System_Font, TE_Center ) ;
- END ; { make_second }
-
- PROCEDURE make_box( VAR doflag : boolean ; VAR main_opt : string ;
- VAR second_opt : string ; VAR mask : string ) ;
- VAR
- dialog : Dialog_Ptr ;
- button, cancel_btn, ok_btn, boxtitle,
- prompt1_item, prompt2_item, prompt3_item, prompt4_item, prompt5_item,
- prompt6_item, encr_item, mask_item : integer ;
- add, move, update, freshen, extract, delete : integer ;
- run, copy, list, verbose, test, convert : integer ;
- hold, retain, suppr_comp, suppr_warn, suppr_not, encript : integer ;
- key : string ;
- maskline, encrline : string [255] ;
- BEGIN
- dialog := New_Dialog( 30, 0, 0, 70, 20 ) ;
-
- boxtitle := Add_DItem( dialog, G_String, None, 1, 1, 0, 0, 0, 0 ) ;
- Set_DText( dialog, boxtitle,
- 'GEM4ARC1 by William R. Good Released to Public Domain. ARC.TTP must',
- System_Font, TE_Left ) ;
-
- prompt1_item := Add_DItem( dialog, G_String, None, 1, 2, 0, 0, 0, 0 ) ;
- Set_DText( dialog, prompt1_item,
- 'be in current directory. Portions of this product are Copyright (c)',
- System_Font, TE_Left ) ;
-
- prompt2_item := Add_DItem( dialog, G_String, None, 1, 3, 0, 0, 0, 0 ) ;
- Set_DText( dialog, prompt2_item,
- '1986 OSS and CCD. Used by permision of OSS.',
- System_Font, TE_Left ) ;
-
- prompt3_item := Add_DItem( dialog, G_String, None, 1, 4, 0, 1, 0, 0 ) ;
- Set_DText( dialog, prompt3_item,
- 'Make Selections then enter search mask :',
- System_Font, TE_Left ) ;
-
- mask_item := Add_DItem( dialog, G_FText, None, 42, 4, 12,
- 1, 0, $1180 );
-
- Set_DEdit( dialog, mask_item, '____________', 'PPPPPPPPPPPP',
- '*.*', System_Font, TE_Center ) ;
-
- prompt4_item := Add_DItem( dialog, G_String, None, 1, 6, 0, 1, 0, 0 ) ;
- Set_DText( dialog, prompt4_item,
- 'If used enter encript key word :',
- System_Font, TE_Left ) ;
-
- encr_item := Add_DItem( dialog, G_FText, None, 34, 6, 12,
- 1, 0, $1180 );
-
- Set_DEdit( dialog, encr_item, '____________', 'nnnnnnnnnnnn',
- '', System_Font, TE_Center ) ;
-
- prompt5_item := Add_DItem( dialog, G_String, None, 8, 8, 0, 0, 0, 0 ) ;
- Set_DText( dialog, prompt5_item,
- 'MAIN FILE OPTIONS SECONDARY OPTIONS',
- System_Font, TE_Left ) ;
-
- make_main( dialog, add, move, update, freshen, extract, delete,
- run, copy, list, verbose, test, convert ) ;
-
- make_second( dialog, hold, retain, suppr_comp, suppr_warn,
- suppr_not, encript ) ;
-
- cancel_btn := Add_DItem( dialog, G_Button, Selectable|Touch_Exit,
- 1, 17, 10, 2, 1, $1180 ) ;
- Set_DText( dialog, cancel_btn, 'Cancel', System_Font, TE_Center ) ;
- ok_btn := Add_DItem( dialog, G_Button, Selectable|Default|Touch_Exit,
- 12, 17, 10, 2, 1, $1180 ) ;
- Set_DText( dialog, ok_btn, 'OK', System_Font, TE_Center ) ;
-
- Center_Dialog( dialog ) ;
-
- button := Do_Dialog( dialog, mask_item ) ;
-
- if Obj_State ( dialog, ok_btn) & Selected <> 0 then
- begin
- maskline := '' ;
- mask := '' ;
- Get_Dedit ( dialog, mask_item, maskline ) ;
- mask := maskline ;
- doflag := true ;
- main_opt := '' ;
- second_opt := '' ;
- if Obj_State ( dialog, add) & Selected <> 0 then
- main_opt := 'A' ;
- if Obj_State ( dialog, extract) & Selected <> 0 then
- main_opt := 'X' ;
- if Obj_State ( dialog, move) & Selected <> 0 then
- main_opt := 'M' ;
- if Obj_State ( dialog, run) & Selected <> 0 then
- main_opt := 'R' ;
- if Obj_State ( dialog, update) & Selected <> 0 then
- main_opt := 'U' ;
- if Obj_State ( dialog, copy) & Selected <> 0 then
- main_opt := 'P' ;
- if Obj_State ( dialog, freshen) & Selected <> 0 then
- main_opt := 'F' ;
- if Obj_State ( dialog, list) & Selected <> 0 then
- main_opt := 'L' ;
- if Obj_State ( dialog, delete) & Selected <> 0 then
- main_opt := 'D' ;
- if Obj_State ( dialog, verbose) & Selected <> 0 then
- main_opt := 'V' ;
- if Obj_State ( dialog, test) & Selected <> 0 then
- main_opt := 'T' ;
- if Obj_State ( dialog, convert) & Selected <> 0 then
- main_opt := 'C' ;
- { Secondary options IF's }
- if Obj_State ( dialog, hold) & Selected <> 0 then
- second_opt := concat( second_opt, 'H' ) ;
- if Obj_State ( dialog, retain) & Selected <> 0 then
- second_opt := concat( second_opt, 'B' ) ;
- if Obj_State ( dialog, suppr_comp) & Selected <> 0 then
- second_opt := concat( second_opt, 'S' ) ;
- if Obj_State ( dialog, suppr_warn) & Selected <> 0 then
- second_opt := concat( second_opt, 'W' ) ;
- if Obj_State ( dialog, suppr_not) & Selected <> 0 then
- second_opt := concat( second_opt, 'N' ) ;
- if Obj_State ( dialog, encript) & Selected <> 0 then
- second_opt := concat( second_opt, 'G' ) ;
- encrline := '' ;
- Get_DEdit( dialog, encr_item, encrline ) ;
- second_opt := concat( second_opt, encrline ) ;
- End_Dialog ( dialog ) ;
- end ;
- if Obj_State ( dialog, cancel_btn) & Selected <> 0 then
- BEGIN
- doflag := false ;
- End_Dialog( dialog ) ;
- END ;
- END ; {makebox}
-
- BEGIN { main }
- IF Init_Gem >= 0 THEN
- BEGIN
- set_mouse( m_arrow ) ;
- find_rez ;
-
- repeat
- make_box( flag, main_selection, sec_selection, search_mask ) ;
- if flag = true then
- begin
- get_pathname( path ) ;
- path := concat( path, '*.ARC' ) ;
- selection := True ;
- selection := Get_In_File( path, arc_name ) ;
- if selection = True then
- begin
- temp1 := concat('ARC.TTP ',main_selection ) ;
- temp2 := concat(sec_selection, ' ', arc_name ) ;
- temp3 := concat( ' ', search_mask ) ;
- tempname := concat( temp1, temp2, temp3 ) ;
- init_mouse ;
- hide_mouse ;
- clear_screen ;
- chain( tempname ) ;
- show_mouse ;
- end ;
- end ;
- until flag = false ;
- Exit_Gem ;
- END ;
- END. { gem4arc1 }
-